program TVScannerProject;



uses
  Forms,
  Windows,
  ExtCtrls,
  SysUtils,
  InternetPagina_Unit in 'pas\InternetPagina_Unit.pas' {InternetPagina_Form},
  TaskIcon_Unit in 'pas\TaskIcon_Unit.pas',
  Introductie_Unit in 'pas\Introductie_Unit.pas' {Introductie_Form},
  TVScanner_Unit in 'pas\TVScanner_Unit.pas',
  InternHttpClient_Unit in 'pas\InternHttpClient_Unit.pas',
  TVGidsNLParser_Unit in 'pas\TVGidsNLParser_Unit.pas',
  TVScannerManager_Unit in 'pas\TVScannerManager_Unit.pas',
  InformatiePopup_Unit in 'pas\InformatiePopup_Unit.pas' {InformatiePopup_Form},
  TVGidsNLProgrammaLijst_Unit in 'pas\TVGidsNLProgrammaLijst_Unit.pas',
  TVGidsNLProgramma_Unit in 'pas\TVGidsNLProgramma_Unit.pas',
  Mededeling_Unit in 'pas\Mededeling_Unit.pas';

{$R *.res}

var
  TVScanner: TTVScanner;
begin

  //////////////////////////////////////////////////////////////////////////////
  // controleer of TVScanner al draait
  //////////////////////////////////////////////////////////////////////////////

  CreateMutex(nil, False, 'TVSCANNER');
  if GetLastError() = ERROR_ALREADY_EXISTS then begin
    Application.MessageBox('TVScanner draait al op uw systeem.', '', MB_OK );
    exit;
  end;

  //////////////////////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////////

  Application.Initialize;
  Application.Title := 'TVScanner';
  Application.Run;

  TVScanner := Nil;

  try
    //TVScanner creeren
    TVScanner := TTVScanner.Create();
  except

    //er is iets fout gegaan
    Application.MessageBox(PChar('Er is een fout ontstaan. Errorcode: ' +  IntToStr(System.GetLastError)), 'Fout melding', MB_OK);
  end;

  //TVScanner vrijgeven
  if Assigned(TVScanner) then
    TVScanner.Free();
end.
